package kpu.SmartLibrary;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {
	public DBHelper(Context context) {
		super(context, "Library.db", null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String table = "CREATE TABLE book (" + "uid TEXT PRIMARY KEY, "
				+ "title TEXT NOT NULL, " + "writer TEXT NOT NULL);";

		db.execSQL(table);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS book");
		onCreate(db);
	}
}
